#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int main()
{
	int n = 0;
	int m = 0;
	int count = 0;
	scanf("%d %d", &n, &m);
	int c = n ^ m;
	while (c)
	{
		c = c & (c - 1);
		count++;
	}
	printf("%d", count);

	return 0;
}